Most modern file systems include a logging feature to ensure faster write times and crash recovery times. Intent logging is a type of file system journaling that enables faster file system operation and system boot. It is relatively simple to implement and inexpensive to the operation of the file system. Empirical tests have shown that logging file systems perform equal to or better than non-logging file systems.
The logging feature is a common option to a conventional file system. For example, Unix File System (UFS) includes a logging feature. More specifically, UFS supports intent logging. To implement intent logging, UFS initially allocates a certain amount of disk space within the persistent storage (e.g., hard disks, etc.). Within that space, an intent log (i.e., a data structure) is used to store all changes (i.e., “deltas”) made to the metadata associated with the file system. The metadata associated with the file system typically corresponds to information related to the data in the file system, for example, the file name.
Once the metadata changes, the corresponding deltas are stored in the intent log. At a later time, the deltas in the intent log are committed to the file system. To commit the deltas in the intent log to the file system, the intent log is traversed and each delta that is encountered is committed to the file system. Once the file system (or a portion thereof) has been updated with the delta, then the delta is removed from the intent log.
During the typical operation of the logging feature, once a delta is generated (i.e., some file system metadata changes), a certain amount of disk space, in the disk space pre-allocated for the intent log, is requested. The amount of disk space requested corresponds to the size of the delta. If there is no unallocated space in the pre-allocated disk space (i.e., because the pre-allocated disk space is full), then deltas already stored in the intent log must be committed to the file system and removed from the intent log in order to make space for the new delta. While the currently stored deltas are being committed to the file system, applications using the file system are typically blocked until there is sufficient space to insert additional deltas.